/**
 * 
 */
package com.youyun56.gps.android;

import org.json.JSONObject;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.youyun56.gps.android.common.BaseActovity;
import com.youyun56.gps.android.common.CommandFactory;
import com.youyun56.gps.android.http.HttpManager;
import com.youyun56.gps.android.http.IHttpListener;

public class MoreActivity extends BaseActovity {
    private final static String tag = MoreActivity.class.getName();
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.more);
        HttpManager.getInstance().excutePost(CommandFactory.getAdminInfo(), new IHttpListener() {
            
            @Override
            public void onBack(boolean bSuccess, String strData, int nResponseCode) {
                // TODO Auto-generated method stub
                try {
                    JSONObject o = new JSONObject(strData);
                    ((TextView) findViewById(R.id.txtDomain)).setText(o.getString("domain"));
                    ((TextView) findViewById(R.id.txtName)).setText(o.getString("name"));
                    ((TextView) findViewById(R.id.txtAddress)).setText(o.getString("address"));
                    ((TextView) findViewById(R.id.txtTel)).setText(o.getString("tel"));
                } catch (Exception e) {
                    // TODO: handle exception
                    Log.e(tag, e.getMessage(), e);
                }
            }
        });
    }
    
}
